package com.hushow.xxjob.demo.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.util.StopWatch;


@Component
@Slf4j
public class TaskStatusSyncJob {

	@XxlJob("node1JobHandler")
	public ReturnT<String> node1JobHandler(String params) throws InterruptedException {

		log.info("===start node1JobHandler");

		StopWatch sw = new StopWatch();

//		try {
//			if("ok".equals(params)){
//				return ReturnT.SUCCESS;
//			}else{
//				return ReturnT.FAIL;
//			}
//		} catch (Exception e) {
//			log.error("node1JobHandler error:"+e.getMessage(), e);
//			return  new ReturnT(ReturnT.FAIL_CODE, e.getMessage());
//		}finally {
//			if(sw.isRunning()){
//				sw.stop();
//			}
//			log.info("node1JobHandler elapsedTime:{} swStr:{}", sw.getTotalTimeSeconds(), sw.toString());
//		}

		Thread.sleep(60*1000);

		return ReturnT.SUCCESS;
	}


}
